package com.design.facde.car;

// 外观类
class CarProductionFacade {
    private EngineSubsystem engineSubsystem;
    private BodySubsystem bodySubsystem;
    private PaintingSubsystem paintingSubsystem;
    private AssemblySubsystem assemblySubsystem;

    public CarProductionFacade() {
        engineSubsystem = new EngineManufacture();
        bodySubsystem = new BodyManufacture();
        paintingSubsystem = new Painting();
        assemblySubsystem = new Assembly();
    }

    // 简化订购汽车的接口
    public void orderCar() {
        System.out.println("Ordering Car...");
        engineSubsystem.createEngine();
        bodySubsystem.createBody();
        paintingSubsystem.paint();
        assemblySubsystem.assemble();
        System.out.println("Car is ready!");
    }
}
